from selenium.webdriver.common.by import By

from pom.basePage import BasePage

class UserCenter(BasePage):
    welcome_element = (By.XPATH, "/html/body/div/header/nav/div/ul/li[1]/a/span")
    def __init__(self,driver,hostname):
        super().__init__(driver)
        self.url = f"http://{hostname}/jpress/ucenter".format(hostname=hostname)

    def get_welcome_text(self):
        return self.get_text(self.welcome_element)

    def wait_until_welcome_element_present(self):
        self.wait_until_element_present(self.welcome_element)
